home *** CD-ROM | disk | FTP | other *** search
- Path: rcp6.elan.af.mil!rscernix!danpop
- From: danpop@mail.cern.ch (Dan Pop)
- Newsgroups: comp.lang.c
- Subject: Re: What's your compiler's answer?
- Date: 17 Feb 96 22:25:45 GMT
- Organization: CERN European Lab for Particle Physics
- Message-ID: <danpop.824595945@rscernix>
- References: <1996Feb7.140945.28351@cs.rit.edu> <4fq0cq$h9s@hpbblb.bbn.hp.com> <danpop.824432113@rscernix> <4g2a1d$r33@solutions.solon.com>
- NNTP-Posting-Host: ues5.cern.ch
- X-Newsreader: NN version 6.5.0 #7 (NOV)
-
- In <4g2a1d$r33@solutions.solon.com> seebs@solutions.solon.com (Peter Seebach) writes:
-
- >In article <danpop.824432113@rscernix>, Dan Pop <danpop@mail.cern.ch> wrote:
- >>j = i++, i++, i++; /* equivalent to: j = i + 2; i += 3; */
- >
- >Don't you mean "/* equivalent to: j = i; i += 3; */"?
-
- Right.
-
- >(And, of course, it's not equivalent if i is volatile.)
-
- I can be pedantic as well: the semantics of "volatile" WRT the ++ operator
- are implementation defined :-) An implementation is free to replace
- i++, i++, i++ by i += 3, _even_ if i is volatile.
-
- >>If you have any objections to any of these examples, please read the FAQ
- >>before expressing them in the newsgroup.
- >
- >I can't seem to find mine, but I'm pretty sure that comma binds later than
- >assignment, or however you say it. (Not "comma has lower precedence" - C
- >has no precedence, although it may act convincingly like it does.)
-
- If it quacks like a duck...
-
- The behaviour of the C operators _can_ be described in terms of precedence
- and associativity and K&R decided to do so. If it was good enough for
- them...
-
- Dan
- --
- Dan Pop
- CERN, CN Division
- Email: danpop@mail.cern.ch
- Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-